from django.db import models
from apps.api.project.models import ProjectModel
from utils.base_model import BaseModel


class SuiteModel(BaseModel):

    id = models.AutoField(primary_key=True)
    name = models.CharField(max_length=100, verbose_name="该名称", help_text="套件名称", unique=True)
    cases = models.TextField(verbose_name='用例列表', help_text='用例列表', null=True, blank=True, default='')
    project = models.ForeignKey(to=ProjectModel, on_delete=models.CASCADE, verbose_name="所属项目id",
                                help_text="所属项目id", related_name="suite")
    is_delete = models.IntegerField(verbose_name="逻辑删除(0-未删除、1-删除)", help_text="逻辑删除(0-未删除、1-删除)",
                                    default=0)

    class Meta:
        db_table = "dtp_suite"
        verbose_name = "套件"
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.name
